Optimal. Leaf size=38 \[ a^2 x+\frac{2 a b x^{n+1}}{n+1}+\frac{b^2 x^{2 n+1}}{2 n+1} \]
[Out]
_______________________________________________________________________________________
Rubi [A] time = 0.040138, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111 \[ a^2 x+\frac{2 a b x^{n+1}}{n+1}+\frac{b^2 x^{2 n+1}}{2 n+1} \]
Antiderivative was successfully verified.
[In] Int[(a + b*x^n)^2,x]
[Out]
_______________________________________________________________________________________
Rubi in Sympy [F] time = 0., size = 0, normalized size = 0. \[ \frac{2 a b x^{n + 1}}{n + 1} + \frac{b^{2} x^{2 n + 1}}{2 n + 1} + \int a^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In] rubi_integrate((a+b*x**n)**2,x)
[Out]
_______________________________________________________________________________________
Mathematica [A] time = 0.0423635, size = 34, normalized size = 0.89 \[ x \left (a^2+\frac{2 a b x^n}{n+1}+\frac{b^2 x^{2 n}}{2 n+1}\right ) \]
Antiderivative was successfully verified.
[In] Integrate[(a + b*x^n)^2,x]
[Out]
_______________________________________________________________________________________
Maple [A] time = 0.012, size = 41, normalized size = 1.1 \[ x{a}^{2}+{\frac{{b}^{2}x \left ({{\rm e}^{n\ln \left ( x \right ) }} \right ) ^{2}}{1+2\,n}}+2\,{\frac{abx{{\rm e}^{n\ln \left ( x \right ) }}}{1+n}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] int((a+b*x^n)^2,x)
[Out]
_______________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((b*x^n + a)^2,x, algorithm="maxima")
[Out]
_______________________________________________________________________________________
Fricas [A] time = 0.240577, size = 88, normalized size = 2.32 \[ \frac{{\left (b^{2} n + b^{2}\right )} x x^{2 \, n} + 2 \,{\left (2 \, a b n + a b\right )} x x^{n} +{\left (2 \, a^{2} n^{2} + 3 \, a^{2} n + a^{2}\right )} x}{2 \, n^{2} + 3 \, n + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((b*x^n + a)^2,x, algorithm="fricas")
[Out]
_______________________________________________________________________________________
Sympy [A] time = 1.16047, size = 182, normalized size = 4.79 \[ \begin{cases} a^{2} x + 2 a b \log{\left (x \right )} - \frac{b^{2}}{x} & \text{for}\: n = -1 \\a^{2} x + 4 a b \sqrt{x} + b^{2} \log{\left (x \right )} & \text{for}\: n = - \frac{1}{2} \\\frac{2 a^{2} n^{2} x}{2 n^{2} + 3 n + 1} + \frac{3 a^{2} n x}{2 n^{2} + 3 n + 1} + \frac{a^{2} x}{2 n^{2} + 3 n + 1} + \frac{4 a b n x x^{n}}{2 n^{2} + 3 n + 1} + \frac{2 a b x x^{n}}{2 n^{2} + 3 n + 1} + \frac{b^{2} n x x^{2 n}}{2 n^{2} + 3 n + 1} + \frac{b^{2} x x^{2 n}}{2 n^{2} + 3 n + 1} & \text{otherwise} \end{cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((a+b*x**n)**2,x)
[Out]
_______________________________________________________________________________________
GIAC/XCAS [A] time = 0.214771, size = 107, normalized size = 2.82 \[ \frac{2 \, a^{2} n^{2} x + b^{2} n x e^{\left (2 \, n{\rm ln}\left (x\right )\right )} + 4 \, a b n x e^{\left (n{\rm ln}\left (x\right )\right )} + 3 \, a^{2} n x + b^{2} x e^{\left (2 \, n{\rm ln}\left (x\right )\right )} + 2 \, a b x e^{\left (n{\rm ln}\left (x\right )\right )} + a^{2} x}{2 \, n^{2} + 3 \, n + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((b*x^n + a)^2,x, algorithm="giac")
[Out]